/*! \file SimpleTriangleApp.h
 *	\brief <write description for SimpleTriangleApp.h>
 *
 *	created:	2009/11/11
 *	created:	11:11:2009   17:13
 *	filename: 	c:\src\main\prjs\SimpleTriangle\SimpleTriangle\SimpleTriangleApp.h
 *	file path:	c:\src\main\prjs\SimpleTriangle\SimpleTriangle
 *	file base:	SimpleTriangleApp
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#ifndef _SIMPLETRIANGLE_SIMPLETRIANGLEAPP_H_
#define _SIMPLETRIANGLE_SIMPLETRIANGLEAPP_H_

#pragma once

#include <app/SimpleApp.h>
#include <core/SmartPtr.h>
#include <utils/PTree.h>

namespace tt{

namespace gd{
class Driver;
class Device;
class DeviceContext;
class Material;
class Primitive;
} //namespace gd

namespace utils{
class Library;
} //namespace utils

class SimpleTriangleApp : public app::SimpleApp
{
	TT_DECLARE_SELF_AND_BASE(SimpleTriangleApp, app::SimpleApp);
public:
	SimpleTriangleApp();
	virtual ~SimpleTriangleApp(void);

private:
	void update();
	void render();

private:
	virtual void onCreate();
	virtual void onUpdate();
	virtual void onDestroy();

private:
	void configRead();
	void configWrite();

	void createTriangles();
	void clearTriangles();

private:
	utils::PTree m_config;
	bool m_fullScreen;
	UInt m_screenWidth;
	UInt m_screenHeight;

	SharedPtr<gd::Driver> m_gd_driver;
	SharedPtr<gd::Device> m_gd_device;
	SharedPtr<gd::DeviceContext> m_gd_context;

	SharedPtr<gd::Material> m_material;
	SharedPtr<gd::Primitive> m_primitive;
};

} //namespace tt

#endif //_SIMPLETRIANGLE_SIMPLETRIANGLEAPP_H_
